package com.lw.ssm.dto;

import com.lw.ssm.utils.ResultCode;

/**
 * @author Administrator
 * @version 1.0
 * @description:
 * @date 2022/3/10 19:20
 */
public class R {

    private int code;
    private String msg;
    private Object data;



    public static R setOK(){
        return R.setOK(null);
    }

    public static R setOK(Object data){

        return R.setOK(ResultCode.SUCCESS,"success",data);
    }
    public static R setOK(int code,String msg,Object data){
        return setError(code,msg,data);
    }

    public static R setError(int code,String msg,Object data){
        R r=new R();
        r.setCode(code);
        r.setMsg(msg);
        r.setData(data);
        return r;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
